using System.Collections;
using UnityEngine;

public class P_InteractionManager : MonoBehaviour
{
	public Vector2 InteractionRadiusDirection;

	public P_MovementBase PlayerMovement;

	public PlayerManager PlayerManager;

	public Animator InteractDIRController;

	public BoxCollider2D InteractCollider;

	public bool CanInteract = true;

	private void Update()
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown(PlayerInput.Instance.Key_Confirm) && PlayerManager._PlayerState == PlayerManager.PlayerState.Game && CanInteract && !ChatboxManager.Instance.ChatIsCurrentlyRunning && !ChatboxManager.Instance.ChatboxInteractDebounce)
		{
			AttemptInteract();
		}
	}

	private void AttemptInteract()
	{
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		InteractionRadiusDirection = new Vector2(PlayerMovement._anim.GetFloat("MOVEMENTX"), PlayerMovement._anim.GetFloat("MOVEMENTY"));
		InteractDIRController.SetFloat("DIRX", InteractionRadiusDirection.x);
		InteractDIRController.SetFloat("DIRY", InteractionRadiusDirection.y);
		((MonoBehaviour)this).StartCoroutine(InteractCheckTimer());
	}

	private IEnumerator InteractCheckTimer()
	{
		((Behaviour)InteractCollider).enabled = true;
		yield return (object)new WaitForSeconds(0.0333f);
		((Behaviour)InteractCollider).enabled = false;
	}
}
